package com.oa.service.impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.oa.bean.SeriesPie;
import com.oa.dao.StatisticalReport;
import com.oa.service.StatisticalReportService;

@Service
public class StatisticalReportServiceImpl implements StatisticalReportService{

	@Autowired
	StatisticalReport statisticalReport;
	@Override
	public Map<String, Object> getPiechart() {
		// TODO Auto-generated method stub
		List<SeriesPie> seriesList = statisticalReport.selectSeriesPie();
		//封装图例
		List<String> legend = new ArrayList<String>();
		for(SeriesPie series: seriesList){
			legend.add(series.getName());
			System.out.println(series.getName());
		}
		Map<String,Object> map = new HashMap<>();
		map.put("seriesList", seriesList);
		map.put("legend", legend);
		return map;
	}

}
